# 读取日志文件a.log和b.log两个文件，获取两个文件中的交集
# 按照行读取，转为集合
with open('a.log', mode='r') as fr1:
    # 读取所有的行
    alist = fr1.readlines()
    # print(alist)
with open('b.log', mode='r') as fr2:
    blist = fr2.readlines()
    # print(blist)
# 转为集合
aset = set(alist)
bset = set(blist)
# print(aset)
# print(bset)
# 计算交集
result = aset & bset
# print(result)
# 转回列表
print(list(result))